package zzz.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import zzz.mapper.AdverMapper;
import zzz.model.Advertising;
import zzz.service.AdverService;

@Service
@Transactional
public class AdverServiceImpl implements AdverService{

	@Autowired
	private AdverMapper mapper;
	@Override
	public List<Advertising> getAllAdver() {
		// TODO Auto-generated method stub
		List<Advertising> advers=mapper.getAllAdvers();
		return advers;
	}
	@Override
	public int newAdver(Advertising adver) {
		// TODO Auto-generated method stub
		int i=mapper.addAdver(adver);
		return i;
	}
	@Override
	public int delAdver(String adverId) {
		// TODO Auto-generated method stub
		int result=mapper.delAdver(adverId);
		return result;
	}
	@Override
	public Advertising findAdById(String adverId) {
		// TODO Auto-generated method stub
		Advertising ad=mapper.findAdById(adverId);
		return ad;
	}

}
